package cc.vv.btpartyjob.partyservice.delegate

import android.widget.TextView
import cc.vv.baselibrary.view.BaseTopBarView
import cc.vv.btpartyjob.partyservice.R
import cc.vv.mvp.delegate.BaseAppDelegate

/**
 * 发布留言托管类
 * Created by Chen.qi on 2018/10/27.
 */
class SubmitMessageActivityDelegate : BaseAppDelegate() {

    override fun initWidget() {

    }

    override fun initLayoutRes(): Int {
        return R.layout.activity_submit_message
    }

    /**设置标题title*/
    fun setTopBarTitle(topBarTitle: String) {
        val titleBar = getView<BaseTopBarView>(R.id.btv_asm_topBar)
        titleBar?.setTitle(topBarTitle)
    }


    /**设置标题右边按钮点击事件*/
    fun setTitleBackBtnOnClick(event: BaseTopBarView.EventInterface) {
        val titleBar = getView<BaseTopBarView>(R.id.btv_asm_topBar)
        titleBar?.setEventInterface(event)
    }

    /**
     * 设置name
     */
    fun setName(name: String?) {
        val viewName = getView<TextView>(R.id.et_asm_inputName)
        viewName?.text = name
    }

    /**
     * 设置电话
     */
    fun setMobile(phone: String?) {
        val viewMobile = getView<TextView>(R.id.et_asm_inputTelPhone)
        viewMobile?.text = phone
    }

    /**
     * 获取标题
     */
    fun getTitle(): String {
        val viewTitle = getView<TextView>(R.id.et_asm_inputTitle)
        return viewTitle?.text.toString().trim()
    }

    /**
     * 获取内容
     */
    fun getContent(): String {
        val viewContent = getView<TextView>(R.id.et_asm_inputContent)
        return viewContent?.text.toString().trim()
    }

}